using UnityEngine;
using Utility; // 添加这行
public class Enemy3 : EnemyBase
{
    
    public override void LaunchSkill(Vector2 dir)
    {
        GameObject go;
        
        // 使用对象池生成子弹
        if (ObjectPool.Instance != null)
        {
            go = ObjectPool.Instance.SpawnFromPool("enemyBullet", transform.position, Quaternion.identity);
        }
        else
        {
            // 如果对象池不可用，则使用原始方法实例化
            go = Instantiate(GameManager.Instance.enemyBullet_prefab, transform.position, Quaternion.identity);
        }
        
        // 设置子弹方向
        go.GetComponent<EnemyBullet>().dir = dir;
    }
}